//
//  CombinationCell.m
//  瀑布流
//
//  Created by ln on 15/11/4.
//  Copyright © 2015年 fancyLi. All rights reserved.
//

#import "CombinationCell.h"
#import "Header.h"

@implementation CombinationCell


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.backgroundColor = [UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:0.4];
        _titleLabel.font = [UIFont systemFontOfSize:12];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.textColor = [UIColor whiteColor];
        
        
//        _creatTimeLabel = [[UILabel alloc]init];
//        _creatTimeLabel.backgroundColor = [UIColor colorWithRed:77/255.0 green:208/255.0 blue:225/255.0 alpha:0.4];
//        _creatTimeLabel.textAlignment = NSTextAlignmentCenter;
//        _creatTimeLabel.textColor = [UIColor whiteColor];
        
        
        _themeImageView = [[UIImageView alloc]init];

        _themeImageView.layer.borderWidth = 1;
        _themeImageView.layer.borderColor = Bg_Color.CGColor;
        
        
        [self.contentView addSubview:_themeImageView];
        [self.contentView addSubview:_titleLabel];
//        [self.contentView addSubview:_creatTimeLabel];
    }
    
    return self;
}
/**
 *  在这里可以布局contentView里面的控件
 *
 *  @param layoutAttributes 直接继承于NSObject 形式上类似于CALayer
 */
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    _themeImageView.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height);
    
    _titleLabel.frame = CGRectMake(0, layoutAttributes.frame.size.height- My_Height(21), layoutAttributes.frame.size.width, My_Height(21));
    
    _creatTimeLabel.frame = CGRectMake(0, CGRectGetMaxY(_titleLabel.frame), layoutAttributes.frame.size.width, My_Height(21));
}

@end
